package com.netjava.service.impl;

import java.util.List;

import com.netjava.dao.IDeliveryDAO;
import com.netjava.pojo.Delivery;
import com.netjava.service.IDeliveryService;

/**
 * 配送业务的实施类。
 * @author nana
 *
 */
public class DeliveryService implements IDeliveryService {

	private IDeliveryDAO deliveryDao;
	public void addDelivery(Delivery delivery) {
		deliveryDao.save(delivery);
	}

	public void delete(Delivery delivery) {
		deliveryDao.delete(delivery);
	}

	public Delivery getDeliveryById(Integer id) {
		return deliveryDao.findById(id);
	}

	public IDeliveryDAO getDeliveryDao() {
		return deliveryDao;
	}

	public void setDeliveryDao(IDeliveryDAO deliveryDao) {
		this.deliveryDao = deliveryDao;
	}

	public List<Delivery> getByDeliverState(Integer deliverState) {
		List<Delivery> list=deliveryDao.findByDeliverState(deliverState);
		return list;
	}
	public void attachDirty(Delivery instance){
		deliveryDao.attachDirty(instance);
	}

}
